# Copyright (c) 2024 - 2025 Kevin G. Schlosser

from typing import Optional, ClassVar, TYPE_CHECKING, Union


if TYPE_CHECKING:
    import lvgl as _lv  # NOQA
    import display_driver_framework as _display_driver_framework
    from keypad_framework import KeypadDriver as _KeypadDriver
    from pointer_framework import PointerDriver as _PointerDriver
    from encoder_framework import EncoderDriver as _EncoderDriver
    from button_framework import ButtonDriver as _ButtonDriver


class IndevBase:
    _instance_counter: ClassVar[int] = ...
    _indevs: ClassVar[list]

    PRESSED: ClassVar[int] = ...
    RELEASED: ClassVar[int] = ...

    id: int = ...

    _disp_drv: _lv.display_t = ...
    _py_disp_drv: _display_driver_framework.DisplayDriver

    _height: int = ...
    _width: int = ...

    _indev_drv: _lv.indev_t = ...
    _current_state: int = ...

    def __init__(self, debug: bool=False):  # NOQA
        ...

    def get_width(self) -> int:
        ...

    def get_height(self) -> int:
        ...

    def get_rotation(self) -> int:
        ...

    def _read(self, drv, data):  # NOQA
        ...

    def read(self):
        ...

    def get_type(self) -> int:
        ...

    def send_event(self, code: _lv.event_t, param: int) -> bool:
        ...

    def remove_event(self, index) -> None:
        ...

    def get_event_dsc(self, index) -> Optional[_lv.event_dsc_t]:
        ...

    def get_event_count(self) -> int:
        ...

    def add_event_cb(self, event_cb, filter, user_data) -> None:
        ...

    def search_obj(self, point: _lv.point_t) -> Optional[_lv.obj]:
        ...

    def delete_read_timer(self) -> None:
        ...

    def get_read_timer(self) -> _lv.timer_t:
        ...

    def get_active_obj(self) -> _lv.obj:
        ...

    def wait_release(self) -> None:
        ...

    def get_state(self):
        ...

    def enable(self, en: bool) -> None:
        ...

    def get_group(self):
        ...

    def set_group(self, group) -> None:
        ...

    def reset(self, obj) -> None:
        ...

    def get_disp(self) -> _display_driver_framework.DisplayDriver:
        ...

    @staticmethod
    def active() -> Optional[
        Union[_KeypadDriver, _PointerDriver, _EncoderDriver, _ButtonDriver]
    ]:
        ...
